import { callApi } from '../util/callWithParams';

// 基本信息
export const getBasic = params => callApi('/api/doc/detail/basicInfo', 'GET', params);
// tab
export const getTabInfo = params => callApi('/api/doc/detail/tabInfo', 'GET', params);

// 回复数量
export const getReplyCount = params => callApi('/api/doc/reply/replyCount', 'GET', params);

// 增加阅读日志 阅读数量
export const addReadLog = params => callApi('/api/doc/read/addReadLog', 'GET', params);

export const getReadCount = params => callApi('/api/doc/read/readCount', 'GET', params);

// 属性
export const getAttr = params => callApi('/api/doc/detail/docParamInfo', 'GET', params);

// 打分
export const getScore = params => callApi('/api/doc/score/docScore', 'GET', params);

export const doMark = params => callApi('/api/doc/score/doMarkDoc', 'GET', params);
// 点赞
export const getPraise = params => callApi('/api/doc/praise/praiseInfo', 'GET', params);

export const setPraise = (params, i = false) => (
  callApi(`/api/doc/praise/${i ? 'doPraise' : 'unPraise'}`, 'GET', params)
);

// 回复
export const getReplyList = params => callApi('/api/doc/reply/replyList', 'GET', params);

export const saveReply = params => callApi('/api/doc/reply/saveReply', 'POST', params);

export const getMoreReplyMain = params => callApi('/api/doc/reply/moreReply', 'GET', params);

export const getMoreReplyChild = params => callApi('/api/doc/reply/residueReply', 'GET', params);

export const deleteReply = params => callApi('/api/doc/reply/deleteReply', 'GET', params);

// 获取删除信息
export const deleteWarm = params => callApi('/api/doc/operate/deleteWarm', 'GET', params);

// 删除文档
export const deleteDoc = params => callApi('/api/doc/operate/delete', 'GET', params);

// 失效
export const invalidate = params => callApi('/api/doc/detail/invalidate', 'GET', params);

//发布
export const publishDoc = params => callApi('/api/doc/detail/publishDoc', 'GET', params);

// 置顶 获取设置
export const getTopSet = params => callApi('/api/doc/detail/getTopSet', 'GET', params);

export const setTop = params => callApi('/api/doc/detail/setTop', 'GET', params);

// 获取共享列表
export const getAddShare = params => callApi('/api/doc/share/addShare', 'GET', params);

// 添加共享条件
export const doShareAddSubmit = params => callApi('/api/doc/share/saveShare', 'POST', params);

// 共享可编辑权限
export const canShareAddEdit = params => callApi('/api/doc/share/canEdit', 'GET', params);

// 删除共享条件
export const deleteShare = params => callApi('/api/doc/share/deleteShare', 'GET', params);

// 编辑共享条件确定
export const afterShareSave = params => callApi('/api/doc/save/afterSave', 'GET', params);

// 转换文件
export const convertFile = params => callApi('/api/doc/acc/convertFile', 'GET', params);

// 草稿提交
export const draftSubmit = params => callApi('/api/doc/save/submit', 'POST', params);

// 替换附件
export const docAccReplace = params => callApi('/api/doc/acc/docAccReplace', 'GET', params);

//正文获取附件数据
export const docAutoExtendInfo = (params, moudleParams) => callApi('/api/doc/detail/docAutoExtendInfo?'+moudleParams,'GET',params);
export const reOpen = params => callApi('/api/doc/detail/reOpen','GET',params);

export const reLoad = params => callApi('/api/doc/detail/reLoad','GET',params)


//文档详情，附件版本
export const getFileVersion = params => callApi('/api/doc/acc/docAccVersion', 'GET', params);
//文档详情，打分详情
export const getMarkDetail = params => callApi('/api/doc/score/docMarkDetail', 'GET', params);
//文档详情，文档共享
export const getShareTable = params => callApi('/api/doc/share/list', 'GET', params);
//文档详情，附件列表
export const getAccTable = params => callApi('/api/doc/acc/docAcc', 'GET', params);
//文档详情，文档版本
export const getVersionTable = params => callApi('/api/doc/detail/docVersion', 'GET', params);
//点击编辑的时候，判断是否有人检出文件
export const docfileisCheckOut = params => callApi('/api/doc/save/isCheckOut', 'GET', params);